import { request } from '@/utils/request';

const loginPwd = async (data: Record<string, unknown>) => {
    return request.post({
        url: '/login/username',
        data,
    });
};

const logoutPwd = async () => {
    return request.get({ url: '/login/logout' });
};

const clearCache = async () => {
    return request.get({ url: '/currentUser/cleanCache' });
};
/** 当前登录人信息 */
const currentUser = async () => {
    return request.get({ url: '/currentUser/info' });
};
/** 当前登录人的角色和权限信息 */
const getPermsApi = async () => {
    return request.get({ url: '/currentUser/getPerms' });
};
/** 修改当前登录人的信息 */
const updateApi = async (data: any) => {
    return request.post({ url: '/currentUser/updateUser', data });
};
export { clearCache, currentUser, getPermsApi, loginPwd, logoutPwd, updateApi };
